<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>示例4</title>
    <script src="s4.js"></script>
</head>
<body>
    <script>
        function Student(name,age){
            this.name = name;
            this.age = age;
            this.show = function (){
                console.log(this.name,this.age)
            }
        }

        const stu1 = new Student('rose',22)
        const stu2 = new Student('peter',21)
        stu1.show()
        stu2.show()
        //原型对象 原型链
    </script>
</body>
</html>